package eteam.aps.controller;

import eteam.aps.common.R;
import eteam.aps.common.exceptions.AuthException;
import eteam.aps.common.helper.JsonPage;
import eteam.aps.model.dto.ProductInfoDto;
import eteam.aps.model.vo.DataDictionaryCategoryTreeVo;
import eteam.aps.model.vo.ProductCategoryTreeVo;
import eteam.aps.model.vo.ProductInfoListVo;
import eteam.aps.model.vo.ProductInfoVo;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 产品信息控制器
 */
public interface IProductInfoController {

    @PostMapping("/pe/insert")
    R<Integer> insert(@RequestBody ProductInfoDto equipInfoDto) throws Exception, AuthException;

    @PostMapping("/pe/delete/{fId}")
    R<Integer> delete(@PathVariable String fId) throws Exception, AuthException;

    @PostMapping("/pe/update")
    R<Integer> update(@RequestBody ProductInfoDto equipInfoDto) throws Exception, AuthException;

    @PostMapping("/pe/selectAll")
    R<JsonPage<ProductInfoListVo>> selectAll(
            @RequestParam("fPcId") String fPcId,
            @RequestParam(value = "fEquipCode",required = false) String fEquipCode,
            @RequestParam(value = "fEquipName",required = false) String fEquipName,
            @RequestParam("page") Integer page,@RequestParam("pageSize") Integer pageSize,
            @RequestParam("fProductCategory") Integer fProductCategory
    ) throws Exception, AuthException;

    @PostMapping("/pe/selectDetails/{fId}")
    R<List<ProductInfoVo>> selectDetails(@PathVariable String fId) throws Exception, AuthException;

    @PostMapping("/pe/selectEcTree/{fPcAffProduct}")
    R<List<ProductCategoryTreeVo>> selectEcTree(@PathVariable int fPcAffProduct) throws Exception, AuthException;

    @PostMapping("/pe/setModel")
    R<List<DataDictionaryCategoryTreeVo>> selectDdcSetModel() throws Exception, AuthException;

    @PostMapping("/pe/setEnable/{fId}")
    R<Integer> setEnable(@PathVariable String fId) throws Exception, AuthException;

    @PostMapping("/pe/setDisable/{fId}")
    R<Integer> setDisable(@PathVariable String fId) throws Exception, AuthException;

    @PostMapping("/pe/equipList")
    R<List<ProductInfoVo>> selectEquipList() throws Exception, AuthException;

}
